﻿Imports System.Data.SqlClient
Public Class FormWork

    Private Sub FormWork_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        RefreshData()
    End Sub
    Public Sub RefreshData()
        Cmd.Parameters("@s") = "%" & txtSearch.Text & "%"
        Me.dgv.DataSource = Cmd.ExecuteDataTable("SELECT TBL_EMPLOYEE.Employee_Id,TBL_EMPLOYEE .Employee_Name,TBL_EMPLOYEE.Sex,TBL_EMPLOYEE.Salary,TBL_CHECK.Check_in_Morning,TBL_CHECK.Check_out_Morning,TBL_CHECK.Check_in_Evening,TBL_CHECK.Check_out_Evening,TBL_CHECK.Check_in_Overtime,TBL_CHECK.Check_out_Overtime,TBL_CHECK.Check_Date,TBL_CHECK .Active FROM TBL_EMPLOYEE INNER JOIN TBL_CHECK ON TBL_EMPLOYEE.Employee_Id=TBL_CHECK.Employee_Id WHERE  UPPER (Employee_Name) LIKE UPPER('%'+@S+'%')")
    End Sub
    Private Sub txtSearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSearch.TextChanged
        RefreshData()
    End Sub
End Class